
#使用aiohttp搭建一个简单web服务器 书中 471页 

#官网的简单例子
from aiohttp import web

from aiohttp import web

async def handle(request):
    name = request.match_info.get('name', "Anonymous")
    text = "Hello, " + name
    return web.Response(text=text)

app = web.Application()
app.router.add_get('/', handle)
app.router.add_get('/{name}', handle)

web.run_app(app,host='127.0.0.1',port=2345)